home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global CR, Sep, CDLocation, NoQuiz, FirstQuiz, LengthOfFile, sync, BoxUp
- if the machineType = 256 then
- set the transitionType of member 52 of castLib 2 to 26
- set CR to RETURN & numToChar(10)
- set Sep to "\"
- openXLib(CDLocation & "OTHER\FILEIO.DLL")
- else
- set the transitionType of member 52 of castLib 2 to 23
- set CR to RETURN
- set Sep to ":"
- end if
- set LengthOfFile to 15
- if the frame > 15 then
- SoundControl()
- end if
- HideScore()
- set FirstQuiz to 0
- set NoQuiz to 0
- set sync to 0
- set BoxUp to 0
- set the fileName of member 34 of castLib 2 to CDLocation & "Movies&Sep&Clock.mov"
- end
-
- on InputName
- global LengthOfFile, name, BoxUp, OpenType, Difficulty, Screen, AutoQuiz, NewScores, ReadScores, Temp, Counter, Error, PopQuizTime, NoQuiz, QuizWaiting, TimeToQuiz
- BSuspend(18, 19)
- set the visible of sprite 23 to 1
- set the visible of sprite 17 to 1
- go("BoxDown")
- set fileName to line 1 of field "FileName"
- if OpenType = "New" then
- if length(line 1 of field "FileName") <= 2 then
- beep()
- put "I'm sorry. That name is too short. Please try another name." into field "MsgBox"
- set Error to 1
- go("Error")
- set the visible of sprite 23 to 0
- exit
- end if
- set NewScores to FileIO(mnew, "?write", fileName)
- cursor(4)
- if NewScores < 0 then
- CancelBox()
- cursor(-1)
- exit
- end if
- NewScoreFile()
- end if
- set Error to 0
- if OpenType = "New" then
- set ReadScores to FileIO(mnew, "read", name)
- end if
- cursor(4)
- if OpenType <> "New" then
- if the machineType = 256 then
- set ReadScores to FileIO(mnew, "?read", "txt")
- else
- set ReadScores to FileIO(mnew, "?read", "TEXT")
- end if
- if ReadScores < 0 then
- CancelBox()
- cursor(-1)
- exit
- end if
- set name to ReadScores(mFileName)
- end if
- repeat with Counter = 1 to LengthOfFile + 1
- set Temp to ReadScores(mReadLine)
- if (Counter = 1) and (Temp <> ("Great Canadian Scientists Player Record" & RETURN)) then
- FileError(0)
- end if
- if (Temp = EMPTY) and (Counter <= LengthOfFile) then
- FileError(1)
- end if
- if (Temp <> EMPTY) and (Counter > LengthOfFile) then
- FileError(2)
- end if
- if the result = 1 then
- put "ERROR"
- exit
- end if
- end repeat
- ReadScoreFile()
- set BoxUp to 0
- set AutoQuiz to 1
- if OpenType = "New" then
- go("Main Menu Intro")
- end if
- if OpenType = "Open" then
- go("Main Menu")
- end if
- set PopQuizTime to the ticks
- set NoQuiz to 0
- set QuizWaiting to 0
- SetTimeToQuiz()
- end
-
- on ReadScoreFile
- global name, Difficulty, Screen, DataBaseEnter, sound, SoundFX, QuizFreq, SalmonFishing, PatternMatching, ChromosomePairing, MemoryTesting, MapAnalysing, RhombusTiling, AtomReacting, PopQuizScore
- set ReadScores to FileIO(mnew, "read", name)
- set IDLine to ReadScores(mReadLine)
- set Difficulty to value(ReadScores(mReadLine))
- set Screen to value(ReadScores(mReadLine))
- set DataBaseEnter to value(ReadScores(mReadLine))
- set sound to value(ReadScores(mReadLine))
- set SoundFX to value(ReadScores(mReadLine))
- set QuizFreq to value(ReadScores(mReadLine))
- set SalmonFishing to value(ReadScores(mReadLine))
- set MemoryTesting to value(ReadScores(mReadLine))
- set ChromosomePairing to value(ReadScores(mReadLine))
- set PatternMatching to value(ReadScores(mReadLine))
- set MapAnalysing to value(ReadScores(mReadLine))
- set RhombusTiling to value(ReadScores(mReadLine))
- set AtomReacting to value(ReadScores(mReadLine))
- set PopQuizScore to value(ReadScores(mReadLine))
- ReadScores(mdispose)
- end
-
- on NewScoreFile
- global Difficulty, name, CR
- set name to NewScores(mFileName)
- NewScores(mWriteString, "Great Canadian Scientists Player Record" & CR)
- NewScores(mWriteString, Difficulty & CR)
- NewScores(mWriteString, "0" & CR)
- NewScores(mWriteString, "0" & CR)
- NewScores(mWriteString, "1" & CR)
- NewScores(mWriteString, "3" & CR)
- NewScores(mWriteString, "1" & CR)
- NewScores(mWriteString, "0" & CR)
- NewScores(mWriteString, "0" & CR)
- NewScores(mWriteString, "0" & CR)
- NewScores(mWriteString, "0" & CR)
- NewScores(mWriteString, "0" & CR)
- NewScores(mWriteString, "0" & CR)
- NewScores(mWriteString, "0" & CR)
- NewScores(mWriteString, "0")
- NewScores(mdispose)
- end
-
- on FileError Num
- beep()
- put Num
- ReadScores(mdispose)
- put "I'm sorry, something is wrong with your record. Please create a new record." into field "MsgBox"
- cursor(-1)
- go("Error")
- return 1
- end
-
- on CancelBox
- global BoxUp
- set the visible of sprite 23 to 1
- set the visible of sprite 17 to 1
- BSetup(8, 9)
- BSuspend(18, 19)
- go("BoxDown")
- set BoxUp to 0
- end
-
- on KeyCheck
- global BoxUp
- if BoxUp = 1 then
- if the key = RETURN then
- InputName()
- end if
- if the keyCode = 53 then
- CancelBox()
- dontPassEvent()
- end if
- end if
- end
-
- on KeyCheckE
- global BoxUp
- if BoxUp = 1 then
- if the key = RETURN then
- ShowBox()
- end if
- end if
- end
-
- on ShowBox
- global Error, BoxUp
- BSuspend(22, 22)
- if Error = 1 then
- go("BoxUp")
- end if
- if Error = 0 then
- set BoxUp to 0
- go("BoxDown")
- BSetup(8, 9)
- end if
- end
-
- on idle
- if the frame > 80 then
- PopIdle()
- end if
- SoundLoop()
- end
-
- on NoPass
- dontPassEvent()
- end
-
- on Help
- cursor(4)
- go("Main Menu Help")
- end
-
- on CheckRollover
- set on to 0
- repeat with count = 25 down to 14
- if on = 0 then
- if rollOver(count) = 1 then
- if (the castNum of sprite (count - 12) mod 3) = 1 then
- set the castNum of sprite (count - 12) to the castNum of sprite (count - 12) + 1
- end if
- if the stillDown = 0 then
- if (the castNum of sprite (count - 12) mod 3) = 0 then
- set the castNum of sprite (count - 12) to the castNum of sprite (count - 12) - 1
- end if
- else
- if (the castNum of sprite (count - 12) mod 3) = 2 then
- set the castNum of sprite (count - 12) to the castNum of sprite (count - 12) + 1
- end if
- end if
- set on to 1
- else
- ResetButtons(count)
- end if
- next repeat
- end if
- ResetButtons(count)
- end repeat
- end
-
- on ResetButtons count
- if (the castNum of sprite (count - 12) mod 3) = 2 then
- set the castNum of sprite (count - 12) to the castNum of sprite (count - 12) - 1
- end if
- if (the castNum of sprite (count - 12) mod 3) = 0 then
- set the castNum of sprite (count - 12) to the castNum of sprite (count - 12) - 2
- end if
- end
-
- on RestartProgram
- global name, Screen, sync, FirstQuiz, sound, SoundFX, QuizFreq, Difficulty
- cursor(4)
- BSuspend(30, 41)
- BSuspend(7, 18)
- BSuspend(22, 25)
- BSuspend(47, 48)
- ScoreToFile()
- set FirstQuiz to 0
- set QuizFreq to 1
- set sound to 3
- set SoundFX to 3
- set sync to 0
- set Screen to 0
- set Difficulty to 1
- SoundControl()
- updateStage()
- go("Startup Menu")
- set name to EMPTY
- cursor(-1)
- end
-
- on GoMain
- go("Main From Intro")
- end
-